import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import('../views/login')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/home'),
    children: [
      {
        path: 'task',
        name: 'Task',
        component: () => import('../views/home/components/task')
      },
      {
        path: 'workbench',
        name: 'Workbench',
        component: () => import('../views/home/components/workbench'),
      },
      {
        path: 'workbench/files',
        name: 'files',
        component: () => import('../views/home/components/workbench/files'),
      },
      {
        path: 'favorites',
        name: 'Favorites',
        component: () => import('../views/home/components/favorites')
      },
      {
        path: 'recycle',
        name: 'Recycle',
        component: () => import('../views/home/components/recycle')
      },
    ]
  },
  {
    path: '/file',
    name: 'File',
    component: () => import('../views/file')
  },
  {
    path: '/invalidation',
    name: 'invalidation',
    component: () => import('../views/Invalidation')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
